package com.zzjson.thread.volatiles;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2019 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : com.zzjson.thread.volatiles</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2019年08月14日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class VolatileDemo extends Thread {
	public static boolean stop;

	public static void main(String[] args) {
		new VolatileDemo().start();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("-------");
		stop = true;
		System.out.println("stop");
	}

	@Override
	public void run() {
		while (!stop) {
			System.out.println("do");
		}
	}
}